package com.bestcem.xm.label.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.common.core.sql.ColumnDesc;
import com.bestcem.xm.label.grpc.service.param.LabelMembersParam;

import java.util.Map;

/**
 * @author ming.xue <ming.xue@idiaoyan.com>
 * @desc 自动打标签服务
 * @date 2021-05-18
 */
public interface LabelMemberService {
    /**
     * 给联系人打标签
     *
     * @param param
     * @return
     */
    ServiceResult<Void> labelMembers(LabelMembersParam param);

    /**
     * 编译自动条件
     *
     * @param orgId
     * @param condition
     * @param <T>
     * @return
     */
    <T> ServiceResult<Wrapper<T>> compileCondition(String orgId, String condition);

    /**
     * 编译自动条件
     *
     * @param orgId
     * @param condition
     * @param features
     * @param <T>
     * @return
     */
    <T> ServiceResult<Wrapper<T>> compileCondition(String orgId, String condition, int features);

    /**
     * 编译自动条件
     *
     * @param orgId
     * @param condition
     * @param columnMapping
     * @param tableAlias
     * @param features
     * @param <T>
     * @return
     */
    <T> ServiceResult<Wrapper<T>> compileCondition(String orgId, String condition,
                                                   Map<String, ColumnDesc> columnMapping, String tableAlias,
                                                   int features);
}
